package TestClasser;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import ControlLayer.*;
import ModelLayer.Product;
import ModelLayer.SaleLineItem;
import ModelLayer.SaleOrder;

public class SaleLineItemCtrTest {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void test() {
		fail("Not yet implemented");
	}

	
	public void testCreateSaleLineItem() 
	{
	System.out.println("Creater en SaleLineItem");
	SaleLineItemCtr sli = new SaleLineItemCtr();
	sli.createSaleLineItem(1, 50, 1);
	if(sli.findSaleOrderId(1) != null)
	{
		System.out.println("you did it");
	}
	else{
		System.out.println(":(");
	}
	System.out.println("Du er noget hertil ");
	
	}
	
	
	public void deleteSaleOrder()
	{
		System.out.println("Sletter en ordrer");
		SaleOrderCtr soc = SaleOrderCtr.getInstance();
		soc.deleteSaleOrder(1);
		
	}
	
	@Test
     public void testFindSaleOrderId() 
	 {
     	System.out.println("Finder en saleOrder vha. ID.");
        SaleLineItemCtr sli = new SaleLineItemCtr();
        SaleLineItem slis = sli.findSaleOrderId(1);
        if(slis != null)
        {
        	System.out.println(""+sli.findSaleOrderId(1)+"");
        }
        else {
        	System.out.println("FEJL");
        }  		
	 }
	
	
	
	
	
	
}